﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Nhap_ChiTieuKyThuat.ascx.cs" Inherits="uicontrol_CT_KinhTe" %>
<asp:Label ID="Label1" runat="server" Text="NHẬP CÁC CHỈ TIÊU KỸ THUẬT" CssClass="LabelTitle"></asp:Label>
<br />
<br />
<table>
    <tr>
        <td >
            <asp:Label ID="Label2" runat="server" CssClass="Label" Text="Tên Hội đồng"></asp:Label></td>
        <td>
            <asp:DropDownList ID="ddlHD" runat="server" CssClass="DropdownList" DataSourceID="dsHD"
                DataTextField="TenHoiDong" DataValueField="MaHoiDong" AutoPostBack="True" OnSelectedIndexChanged="ddlHD_SelectedIndexChanged" TabIndex="1">
            </asp:DropDownList></td>
        <td>
        </td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label3" runat="server" CssClass="Label" Text="Tên Sản phẩm"></asp:Label></td>
        <td>
            <asp:DropDownList ID="ddlSP" runat="server" CssClass="DropdownList" DataSourceID="dsSP"
                DataTextField="TenSanPham" DataValueField="MaSanPham" AutoPostBack="True" OnSelectedIndexChanged="ddlSP_SelectedIndexChanged" TabIndex="2">
            </asp:DropDownList></td>
        <td>
        </td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label4" runat="server" CssClass="Label" Text="Giá trị tổng doanh thu (Q)"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtTDT" runat="server" CssClass="TextBox" MaxLength="25" TabIndex="3">0</asp:TextBox>
            <asp:Label ID="Label10" runat="server" CssClass="Label" Text="đồng"></asp:Label></td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Không được trống" ControlToValidate="txtTDT" CssClass="ValidateLabel" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtTDT"
                CssClass="ValidateLabel" Display="Dynamic" ErrorMessage="Giá trị phải > 0" ValidationExpression="(^[0-9]*[1-9]+[0-9]*\.[0-9]*$)|(^[0-9]*\.[0-9]*[1-9]+[0-9]*$)|(^[0-9]*[1-9]+[0-9]*$)"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label5" runat="server" CssClass="LabelSymbol" Text="b"></asp:Label>
            <asp:Label ID="Label14" runat="server" CssClass="Label" Text="T"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtbT" runat="server" CssClass="TextBox" MaxLength="4" TabIndex="4">0</asp:TextBox>
            </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtbT"
                CssClass="ValidateLabel" ErrorMessage="Không được trống" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" ControlToValidate="txtbT"
                CssClass="ValidateLabel" Display="Dynamic" ErrorMessage="Giá trị phải < 1" ValidationExpression="^[0]+(\.)?([0-9])?([0-9])?$"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label6" runat="server" CssClass="LabelSymbol" Text="b"></asp:Label>
            <asp:Label ID="Label11" runat="server" CssClass="Label" Text="H"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtbH" runat="server" CssClass="TextBox" MaxLength="4" TabIndex="5">0</asp:TextBox>
            </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtbH"
                CssClass="ValidateLabel" ErrorMessage="Không được trống" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtbH"
                CssClass="ValidateLabel" Display="Dynamic" ErrorMessage="Giá trị phải < 1" ValidationExpression="^[0]+(\.)?([0-9])?([0-9])?$"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label7" runat="server" CssClass="LabelSymbol" Text="b"></asp:Label>
            <asp:Label ID="Label12" runat="server" CssClass="Label" Text="I"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtbI" runat="server" CssClass="TextBox" MaxLength="4" TabIndex="6">0</asp:TextBox>
            </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtbI"
                CssClass="ValidateLabel" ErrorMessage="Không được trống" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtbI"
                CssClass="ValidateLabel" Display="Dynamic" ErrorMessage="Giá trị phải < 1" ValidationExpression="^[0]+(\.)?([0-9])?([0-9])?$"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label8" runat="server" CssClass="LabelSymbol" Text="b"></asp:Label>
            <asp:Label ID="Label13" runat="server" CssClass="Label" Text="O"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtbO" runat="server" CssClass="TextBox" MaxLength="4" TabIndex="7">0</asp:TextBox>
            </td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtbO"
                CssClass="ValidateLabel" ErrorMessage="Không được trống" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txtbO"
                CssClass="ValidateLabel" Display="Dynamic" ErrorMessage="Giá trị phải < 1" ValidationExpression="^[0]+(\.)?([0-9])?([0-9])?$"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label9" runat="server" CssClass="Label" Text="Năm"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtNam" runat="server" CssClass="TextBox" MaxLength="4" TabIndex="8"></asp:TextBox></td>
        <td>
            <asp:RegularExpressionValidator ID="revNam" runat="server" ControlToValidate="txtNam"
                CssClass="ValidateLabel" Display="Dynamic" ErrorMessage="Năm không hợp lệ" ValidationExpression="([1][9][0-9][0-9])|([2][0-1][0-9][0-9])"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="Label15" runat="server" CssClass="Label" Text="Ghi chú"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtGhiChu" runat="server" CssClass="TextArea" MaxLength="512" TextMode="MultiLine" TabIndex="9"></asp:TextBox></td>
        <td>
        </td>
    </tr>
    <tr>
        <td>
        </td>
        <td>
        </td>
        <td>
        </td>
    </tr>
    <tr>
        <td style="text-align: center" colspan="3" >
            <asp:Button ID="btnDongY" runat="server" CssClass="Button" Text="Đồng ý" OnClick="btnDongY_Click" TabIndex="10" />
            &nbsp; &nbsp; &nbsp;
            <asp:Button ID="btnCancel" runat="server" Text="Làm lại" CausesValidation="False" OnClick="btnCancel_Click" TabIndex="11" /></td>
    </tr>
</table>
<asp:SqlDataSource ID="dsHD" runat="server" ConnectionString="<%$ ConnectionStrings:evaConn %>"
    ProviderName="<%$ ConnectionStrings:evaConn.ProviderName %>" SelectCommand="SELECT MaHoiDong, TenHoiDong FROM HoiDong WHERE (MaDoanhNghiep = @MaDoanhNghiep) AND (Status = 1)" DataSourceMode="DataReader">
    <SelectParameters>
        <asp:SessionParameter Name="MaDoanhNghiep" SessionField="CompanyID" />
    </SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="dsSP" runat="server" ConnectionString="<%$ ConnectionStrings:evaConn %>"
    ProviderName="<%$ ConnectionStrings:evaConn.ProviderName %>" SelectCommand="SELECT MaSanPham, TenSanPham FROM SanPham WHERE (Status = 1) AND (MaDoanhNghiep = @MaDoanhNghiep)" DataSourceMode="DataReader">
    <SelectParameters>
        <asp:SessionParameter Name="MaDoanhNghiep" SessionField="CompanyID" />
    </SelectParameters>
</asp:SqlDataSource><asp:SqlDataSource ID="dsExist" runat="server" ConnectionString="<%$ ConnectionStrings:evaConn %>"
    ProviderName="<%$ ConnectionStrings:evaConn.ProviderName %>" 
    SelectCommand="SELECT MaSanPham, MaHoiDong, Q, BetaT, BetaH, BetaI, BetaO, GhiChu, Nam FROM TieuChuanKyThuat WHERE (MaSanPham = @MaSanPham) AND (MaHoiDong = @MaHoiDong)" 
    UpdateCommand="UPDATE TieuChuanKyThuat SET Q = @Q, BetaT = @bT, BetaH = @bH, BetaI = @bI, BetaO = @bI, GhiChu = @GhiChu, Nam = @Nam, MaSanPham =, MaHoiDong = WHERE (MaSanPham = @MaSanPham) AND (MaHoiDong = @MaHoiDong)" InsertCommand="INSERT INTO TieuChuanKyThuat(MaSanPham, MaHoiDong, Q, BetaT, BetaH, BetaI, BetaO, GhiChu, Nam) VALUES (@MaSanPham, @MaHoiDong, @Q, @bT, @bH, @bI, @bO, @GhiChu, @Nam)">
    <UpdateParameters>
        <asp:ControlParameter ControlID="txtTDT" Name="Q" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtbT" Name="bT" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtbH" Name="bH" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtbI" Name="bI" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtGhiChu" Name="GhiChu" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtNam" Name="Nam" PropertyName="Text" />
        <asp:ControlParameter ControlID="ddlSP" Name="MaSanPham" PropertyName="SelectedValue" />
        <asp:ControlParameter ControlID="ddlHD" Name="MaHoiDong" PropertyName="SelectedValue" />
    </UpdateParameters>    
    <InsertParameters>
        <asp:ControlParameter ControlID="ddlSP" Name="MaSanPham" PropertyName="SelectedValue" />
        <asp:ControlParameter ControlID="ddlSP" Name="MaHoiDong" PropertyName="SelectedValue" />
        <asp:ControlParameter ControlID="txtTDT" Name="Q" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtbT" Name="bT" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtbH" Name="bH" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtbI" Name="bI" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtbO" Name="bO" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtGhiChu" Name="GhiChu" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtNam" Name="Nam" PropertyName="Text" />
    </InsertParameters>
</asp:SqlDataSource>
